home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / wingdi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  41.9 KB  |  1,209 lines

  1. /*++
  2.  
  3. Copyright (c) 1995-1998  Microsoft Corporation
  4.  
  5. Module Name: wingdi.h
  6.  
  7. --*/
  8. #ifndef _WINGDI_H_
  9. #define _WINGDI_H_
  10.  
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. #include <windef.h>
  16.  
  17.  
  18. typedef struct tagPALETTEENTRY {
  19.     BYTE        peRed;
  20.     BYTE        peGreen;
  21.     BYTE        peBlue;
  22.     BYTE        peFlags;
  23. } PALETTEENTRY, *PPALETTEENTRY, FAR *LPPALETTEENTRY;
  24.  
  25. /* Logical Palette */
  26. typedef struct tagLOGPALETTE {
  27.     WORD        palVersion;
  28.     WORD        palNumEntries;
  29.     PALETTEENTRY        palPalEntry[1];
  30. } LOGPALETTE, *PLOGPALETTE, NEAR *NPLOGPALETTE, FAR *LPLOGPALETTE;
  31.  
  32.  
  33. #define TRUETYPE_FONTTYPE       0x0004  
  34. #define LF_FACESIZE                32
  35.  
  36. typedef struct tagLOGFONTA
  37. {
  38.     LONG      lfHeight;
  39.     LONG      lfWidth;
  40.     LONG      lfEscapement;
  41.     LONG      lfOrientation;
  42.     LONG      lfWeight;
  43.     BYTE      lfItalic;
  44.     BYTE      lfUnderline;
  45.     BYTE      lfStrikeOut;
  46.     BYTE      lfCharSet;
  47.     BYTE      lfOutPrecision;
  48.     BYTE      lfClipPrecision;
  49.     BYTE      lfQuality;
  50.     BYTE      lfPitchAndFamily;
  51.     CHAR      lfFaceName[LF_FACESIZE];
  52. } LOGFONTA, *PLOGFONTA, NEAR *NPLOGFONTA, FAR *LPLOGFONTA;
  53.  
  54. typedef struct tagLOGFONTW
  55. {
  56.     LONG      lfHeight;
  57.     LONG      lfWidth;
  58.     LONG      lfEscapement;
  59.     LONG      lfOrientation;
  60.     LONG      lfWeight;
  61.     BYTE      lfItalic;
  62.     BYTE      lfUnderline;
  63.     BYTE      lfStrikeOut;
  64.     BYTE      lfCharSet;
  65.     BYTE      lfOutPrecision;
  66.     BYTE      lfClipPrecision;
  67.     BYTE      lfQuality;
  68.     BYTE      lfPitchAndFamily;
  69.     WCHAR     lfFaceName[LF_FACESIZE];
  70. } LOGFONTW, *PLOGFONTW, NEAR *NPLOGFONTW, FAR *LPLOGFONTW;
  71.  
  72.  
  73. #define WINUSERAPI
  74.  
  75.  
  76. // @CESYSGEN IF GWES_PGDI || GWES_MGBASE
  77. #define WINGDIAPI
  78.  
  79. #define GDI_ERROR            (0xFFFFFFFFL)
  80. #define ERROR               0
  81.  
  82. #define OBJ_PEN             1
  83. #define OBJ_BRUSH           2
  84. #define OBJ_DC              3
  85. #define OBJ_PAL             5
  86. #define OBJ_FONT            6
  87. #define OBJ_BITMAP          7
  88. #define OBJ_REGION          8
  89. #define OBJ_MEMDC           10
  90. #define OBJ_ENHMETADC       12
  91. #define OBJ_ENHMETAFILE     13
  92.  
  93. #define MIN_OBJ_TYPE        OBJ_PEN
  94. #define MAX_OBJ_TYPE        OBJ_ENHMETAFILE
  95.  
  96. #define CLR_INVALID            0xFFFFFFFF
  97. #define BI_RGB                0
  98.  
  99. /* Parameters for GetStockObject */
  100. #define WHITE_BRUSH         0
  101. #define LTGRAY_BRUSH        1
  102. #define GRAY_BRUSH          2
  103. #define DKGRAY_BRUSH        3
  104. #define BLACK_BRUSH         4
  105. #define NULL_BRUSH          5
  106. #define HOLLOW_BRUSH        NULL_BRUSH
  107. #define WHITE_PEN           6
  108. #define BLACK_PEN           7
  109. #define NULL_PEN            8
  110. #define SYSTEM_FONT         13
  111. #define DEFAULT_PALETTE     15
  112.  
  113. /* Device Parameters for GetDeviceCaps() */
  114. #define DRIVERVERSION 0     /* Device driver version                    */
  115. #define TECHNOLOGY    2     /* Device classification                    */
  116. #define HORZSIZE      4     /* Horizontal size in millimeters           */
  117. #define VERTSIZE      6     /* Vertical size in millimeters             */
  118. #define HORZRES       8     /* Horizontal width in pixels               */
  119. #define VERTRES       10    /* Vertical height in pixels                */
  120. #define BITSPIXEL     12    /* Number of bits per pixel                 */
  121. #define PLANES        14    /* Number of planes                         */
  122. #define NUMBRUSHES    16    /* Number of brushes the device has         */
  123. #define NUMPENS       18    /* Number of pens the device has            */
  124. #define NUMMARKERS    20    /* Number of markers the device has         */
  125. #define NUMFONTS      22    /* Number of fonts the device has           */
  126. #define NUMCOLORS     24    /* Number of colors the device supports     */
  127. #define PDEVICESIZE   26    /* Size required for device descriptor      */
  128. #define CURVECAPS     28    /* Curve capabilities                       */
  129. #define LINECAPS      30    /* Line capabilities                        */
  130. #define POLYGONALCAPS 32    /* Polygonal capabilities                   */
  131. #define TEXTCAPS      34    /* Text capabilities                        */
  132. #define CLIPCAPS      36    /* Clipping capabilities                    */
  133. #define RASTERCAPS    38    /* Bitblt capabilities                      */
  134. #define ASPECTX       40    /* Length of the X leg                      */
  135. #define ASPECTY       42    /* Length of the Y leg                      */
  136. #define ASPECTXY      44    /* Length of the hypotenuse                 */
  137.  
  138. // Printing related DeviceCaps.
  139.  
  140. #define PHYSICALWIDTH   110 /* Physical Width in device units           */
  141. #define PHYSICALHEIGHT  111 /* Physical Height in device units          */
  142. #define PHYSICALOFFSETX 112 /* Physical Printable Area x margin         */
  143. #define PHYSICALOFFSETY 113 /* Physical Printable Area y margin         */
  144.  
  145.  
  146. #ifndef NOGDICAPMASKS
  147.  
  148. /* Device Capability Masks: */
  149.  
  150. /* Device Technologies */
  151. #define DT_PLOTTER          0   /* Vector plotter                   */
  152. #define DT_RASDISPLAY       1   /* Raster display                   */
  153. #define DT_RASPRINTER       2   /* Raster printer                   */
  154. #define DT_RASCAMERA        3   /* Raster camera                    */
  155. #define DT_CHARSTREAM       4   /* Character-stream, PLP            */
  156. #define DT_DISPFILE         6   /* Display-file                     */
  157.  
  158. /* Curve Capabilities */
  159. #define CC_NONE             0   /* Curves not supported             */
  160. #define CC_CIRCLES          1   /* Can do circles                   */
  161. #define CC_PIE              2   /* Can do pie wedges                */
  162. #define CC_CHORD            4   /* Can do chord arcs                */
  163. #define CC_ELLIPSES         8   /* Can do ellipese                  */
  164. #define CC_WIDE             16  /* Can do wide lines                */
  165. #define CC_STYLED           32  /* Can do styled lines              */
  166. #define CC_WIDESTYLED       64  /* Can do wide styled lines         */
  167. #define CC_INTERIORS        128 /* Can do interiors                 */
  168. #define CC_ROUNDRECT        256 /*                                  */
  169.  
  170. /* Line Capabilities */
  171. #define LC_NONE             0   /* Lines not supported              */
  172. #define LC_POLYLINE         2   /* Can do polylines                 */
  173. #define LC_MARKER           4   /* Can do markers                   */
  174. #define LC_POLYMARKER       8   /* Can do polymarkers               */
  175. #define LC_WIDE             16  /* Can do wide lines                */
  176. #define LC_STYLED           32  /* Can do styled lines              */
  177. #define LC_WIDESTYLED       64  /* Can do wide styled lines         */
  178. #define LC_INTERIORS        128 /* Can do interiors                 */
  179.  
  180. /* Polygonal Capabilities */
  181. #define PC_NONE             0   /* Polygonals not supported         */
  182. #define PC_POLYGON          1   /* Can do polygons                  */
  183. #define PC_RECTANGLE        2   /* Can do rectangles                */
  184. #define PC_WINDPOLYGON      4   /* Can do winding polygons          */
  185. #define PC_TRAPEZOID        4   /* Can do trapezoids                */
  186. #define PC_SCANLINE         8   /* Can do scanlines                 */
  187. #define PC_WIDE             16  /* Can do wide borders              */
  188. #define PC_STYLED           32  /* Can do styled borders            */
  189. #define PC_WIDESTYLED       64  /* Can do wide styled borders       */
  190. #define PC_INTERIORS        128 /* Can do interiors                 */
  191.  
  192. /* Clipping Capabilities */
  193. #define CP_NONE             0   /* No clipping of output            */
  194. #define CP_RECTANGLE        1   /* Output clipped to rects          */
  195. #define CP_REGION           2   /* obsolete                         */
  196.  
  197. /* Text Capabilities */
  198. #define TC_OP_CHARACTER     0x00000001  /* Can do OutputPrecision   CHARACTER      */
  199. #define TC_OP_STROKE        0x00000002  /* Can do OutputPrecision   STROKE         */
  200. #define TC_CP_STROKE        0x00000004  /* Can do ClipPrecision     STROKE         */
  201. #define TC_CR_90            0x00000008  /* Can do CharRotAbility    90             */
  202. #define TC_CR_ANY           0x00000010  /* Can do CharRotAbility    ANY            */
  203. #define TC_SF_X_YINDEP      0x00000020  /* Can do ScaleFreedom      X_YINDEPENDENT */
  204. #define TC_SA_DOUBLE        0x00000040  /* Can do ScaleAbility      DOUBLE         */
  205. #define TC_SA_INTEGER       0x00000080  /* Can do ScaleAbility      INTEGER        */
  206. #define TC_SA_CONTIN        0x00000100  /* Can do ScaleAbility      CONTINUOUS     */
  207. #define TC_EA_DOUBLE        0x00000200  /* Can do EmboldenAbility   DOUBLE         */
  208. #define TC_IA_ABLE          0x00000400  /* Can do ItalisizeAbility  ABLE           */
  209. #define TC_UA_ABLE          0x00000800  /* Can do UnderlineAbility  ABLE           */
  210. #define TC_SO_ABLE          0x00001000  /* Can do StrikeOutAbility  ABLE           */
  211. #define TC_RA_ABLE          0x00002000  /* Can do RasterFontAble    ABLE           */
  212. #define TC_VA_ABLE          0x00004000  /* Can do VectorFontAble    ABLE           */
  213. #define TC_RESERVED         0x00008000
  214. #define TC_SCROLLBLT        0x00010000  /* Don't do text scroll with blt           */
  215.  
  216. #endif /* NOGDICAPMASKS */
  217.  
  218. /* Raster Capabilities */
  219. #define RC_NONE
  220. #define RC_BITBLT           1       /* Can do standard BLT.             */
  221. #define RC_BANDING          2       /* Device requires banding support  */
  222. #define RC_SCALING          4       /* Device requires scaling support  */
  223. #define RC_BITMAP64         8       /* Device can support >64K bitmap   */
  224. #define RC_GDI20_OUTPUT     0x0010      /* has 2.0 output calls         */
  225. #define RC_GDI20_STATE      0x0020
  226. #define RC_SAVEBITMAP       0x0040
  227. #define RC_DI_BITMAP        0x0080      /* supports DIB to memory       */
  228. #define RC_PALETTE          0x0100      /* supports a palette           */
  229. #define RC_DIBTODEV         0x0200      /* supports DIBitsToDevice      */
  230. #define RC_BIGFONT          0x0400      /* supports >64K fonts          */
  231. #define RC_STRETCHBLT       0x0800      /* supports StretchBlt          */
  232. #define RC_STRETCHDIB       0x2000      /* supports StretchDIBits       */
  233. #define RC_OP_DX_OUTPUT     0x4000
  234. #define RC_DEVBITS          0x8000
  235.  
  236. #define LOGPIXELSX    88    /* Logical pixels/inch in X                 */
  237. #define LOGPIXELSY    90    /* Logical pixels/inch in Y                 */
  238.  
  239. #define SIZEPALETTE  104    /* Number of entries in physical palette    */
  240. #define NUMRESERVED  106    /* Number of reserved entries in palette    */
  241. #define COLORRES     108    /* Actual color resolution                  */
  242.  
  243. /* Device Capability Masks: */
  244.  
  245. /* Device Technologies */
  246. #define DT_RASDISPLAY       1   /* Raster display                   */
  247.  
  248. #define RDH_RECTANGLES        1
  249.  
  250. #define TRANSPARENT         1
  251. #define OPAQUE              2
  252.  
  253. #define RGB(r,g,b)          ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
  254. #define PALETTERGB(r,g,b)   (0x02000000 | RGB(r,g,b))
  255. /* The PALETTEINDEX macro has been removed.  Use RGB or PALETTEINDEX2BPP instead. */
  256. #define PALETTEINDEX2BPP(i)  (((i)==0)?0x00000000:(((i)==1)?0x00808080:(((i)==2)?0x00C0C0C0:0x00FFFFFF)))
  257.  
  258. #define GetRValue(rgb)  ((BYTE)(rgb))
  259. #define GetGValue(rgb)  ((BYTE)(((WORD)(rgb)) >> 8))
  260. #define GetBValue(rgb)  ((BYTE)((rgb) >> 16))
  261.  
  262. typedef DWORD COLORREF;
  263.  
  264. typedef struct tagRGBQUAD {
  265.         BYTE    rgbBlue;
  266.         BYTE    rgbGreen;
  267.         BYTE    rgbRed;
  268.         BYTE    rgbReserved;
  269. } RGBQUAD, FAR *LPRGBQUAD;
  270.  
  271. typedef struct tagBITMAP {
  272.     LONG        bmType;
  273.     LONG        bmWidth;
  274.     LONG        bmHeight;
  275.     LONG        bmWidthBytes;
  276.     WORD        bmPlanes;
  277.     WORD        bmBitsPixel;
  278.     LPVOID      bmBits;
  279. } BITMAP, *PBITMAP, FAR *LPBITMAP;
  280.  
  281. typedef struct tagBITMAPINFOHEADER {
  282.         DWORD      biSize;
  283.         LONG       biWidth;
  284.         LONG       biHeight;
  285.         WORD       biPlanes;
  286.         WORD       biBitCount;
  287.         DWORD      biCompression;
  288.         DWORD      biSizeImage;
  289.         LONG       biXPelsPerMeter;
  290.         LONG       biYPelsPerMeter;
  291.         DWORD      biClrUsed;
  292.         DWORD      biClrImportant;
  293. } BITMAPINFOHEADER, FAR *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER;
  294.  
  295. typedef struct tagBITMAPINFO {
  296.     BITMAPINFOHEADER    bmiHeader;
  297.     RGBQUAD             bmiColors[1];
  298. } BITMAPINFO, FAR *LPBITMAPINFO, *PBITMAPINFO;
  299.  
  300. #include "pshpack2.h"
  301. typedef struct _tagBITMAPFILEHEADER {
  302.     WORD    bfType;
  303.     DWORD   bfSize;
  304.     WORD    bfReserved1;
  305.     WORD    bfReserved2;
  306.     DWORD   bfOffBits;
  307. } BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
  308. #include "poppack.h"
  309.  
  310. typedef struct tagHANDLETABLE {
  311.     HGDIOBJ     objectHandle[1];
  312. } HANDLETABLE, *PHANDLETABLE, FAR *LPHANDLETABLE;
  313.  
  314. WINGDIAPI  HDC       WINAPI CreateCompatibleDC(HDC);
  315. WINGDIAPI  BOOL      WINAPI DeleteDC(HDC);
  316. WINGDIAPI  BOOL      WINAPI DeleteObject(HGDIOBJ);
  317. WINGDIAPI  COLORREF  WINAPI GetBkColor(HDC);
  318. WINGDIAPI  int       WINAPI GetBkMode(HDC);
  319. WINGDIAPI  HGDIOBJ   WINAPI GetCurrentObject(HDC,UINT);
  320. WINGDIAPI  int       WINAPI GetDeviceCaps(HDC,int);
  321. WINGDIAPI  int       WINAPI GetObjectA(HGDIOBJ, int, LPVOID);
  322. WINGDIAPI  int       WINAPI GetObjectW(HGDIOBJ, int, LPVOID);
  323. WINGDIAPI  DWORD     WINAPI GetObjectType(HGDIOBJ h);
  324. WINGDIAPI  HGDIOBJ   WINAPI GetStockObject(int);
  325. WINGDIAPI  COLORREF  WINAPI GetTextColor(HDC);
  326. WINGDIAPI  HGDIOBJ   WINAPI SelectObject(HDC,HGDIOBJ);
  327. WINGDIAPI  COLORREF  WINAPI SetBkColor(HDC,COLORREF);
  328. WINGDIAPI  int       WINAPI SetBkMode(HDC,int);
  329. WINGDIAPI  COLORREF  WINAPI SetTextColor(HDC,COLORREF);
  330.  
  331. #ifdef UNICODE
  332. #define GetObject   GetObjectW
  333. #else
  334. #define GetObject   GetObjectA
  335. #endif //UNICODE
  336. // @CESYSGEN ENDIF
  337.  
  338.  
  339. // @CESYSGEN IF GWES_MGBASE
  340. /* palette entry flags */
  341. #define PC_RESERVED     0x01    /* palette index used for animation */
  342. #define PC_EXPLICIT     0x02    /* palette index is explicit to device */
  343.  
  344. /* constants for the biCompression field */
  345. #define BI_BITFIELDS  3L
  346.  
  347. #include <pshpack1.h>
  348. typedef struct tagRGBTRIPLE {
  349.         BYTE    rgbtBlue;
  350.         BYTE    rgbtGreen;
  351.         BYTE    rgbtRed;
  352. } RGBTRIPLE;
  353. #include <poppack.h>
  354.  
  355. typedef struct  tagCOLORADJUSTMENT {
  356.     WORD   caSize;
  357.     WORD   caFlags;
  358.     WORD   caIlluminantIndex;
  359.     WORD   caRedGamma;
  360.     WORD   caGreenGamma;
  361.     WORD   caBlueGamma;
  362.     WORD   caReferenceBlack;
  363.     WORD   caReferenceWhite;
  364.     SHORT  caContrast;
  365.     SHORT  caBrightness;
  366.     SHORT  caColorfulness;
  367.     SHORT  caRedGreenTint;
  368. } COLORADJUSTMENT, *PCOLORADJUSTMENT, FAR *LPCOLORADJUSTMENT;
  369.  
  370. /* size of a device name string */
  371. #define CCHDEVICENAME 32
  372.  
  373. /* size of a form name string */
  374. #define CCHFORMNAME 32
  375.  
  376. typedef struct _devicemodeA {
  377.     BYTE   dmDeviceName[CCHDEVICENAME];
  378.     WORD dmSpecVersion;
  379.     WORD dmDriverVersion;
  380.     WORD dmSize;
  381.     WORD dmDriverExtra;
  382.     DWORD dmFields;
  383.     short dmOrientation;
  384.     short dmPaperSize;
  385.     short dmPaperLength;
  386.     short dmPaperWidth;
  387.     short dmScale;
  388.     short dmCopies;
  389.     short dmDefaultSource;
  390.     short dmPrintQuality;
  391.     short dmColor;
  392.     short dmDuplex;
  393.     short dmYResolution;
  394.     short dmTTOption;
  395.     short dmCollate;
  396.     BYTE   dmFormName[CCHFORMNAME];
  397.     WORD   dmLogPixels;
  398.     DWORD  dmBitsPerPel;
  399.     DWORD  dmPelsWidth;
  400.     DWORD  dmPelsHeight;
  401.     DWORD  dmDisplayFlags;
  402.     DWORD  dmDisplayFrequency;
  403.     DWORD  dmICMMethod;
  404.     DWORD  dmICMIntent;
  405.     DWORD  dmMediaType;
  406.     DWORD  dmDitherType;
  407.     DWORD  dmICCManufacturer;
  408.     DWORD  dmICCModel;
  409.     DWORD  dmPanningWidth;
  410.     DWORD  dmPanningHeight;
  411. } DEVMODEA, *PDEVMODEA, *NPDEVMODEA, *LPDEVMODEA;
  412.  
  413. typedef struct _devicemodeW {
  414.     WCHAR  dmDeviceName[CCHDEVICENAME];
  415.     WORD dmSpecVersion;
  416.     WORD dmDriverVersion;
  417.     WORD dmSize;
  418.     WORD dmDriverExtra;
  419.     DWORD dmFields;
  420.     short dmOrientation;
  421.     short dmPaperSize;
  422.     short dmPaperLength;
  423.     short dmPaperWidth;
  424.     short dmScale;
  425.     short dmCopies;
  426.     short dmDefaultSource;
  427.     short dmPrintQuality;
  428.     short dmColor;
  429.     short dmDuplex;
  430.     short dmYResolution;
  431.     short dmTTOption;
  432.     short dmCollate;
  433.     WCHAR  dmFormName[CCHFORMNAME];
  434.     WORD   dmLogPixels;
  435.     DWORD  dmBitsPerPel;
  436.     DWORD  dmPelsWidth;
  437.     DWORD  dmPelsHeight;
  438.     DWORD  dmDisplayFlags;
  439.     DWORD  dmDisplayFrequency;
  440. // #if (WINVER >= 0x0400)
  441. //     DWORD  dmICMMethod;
  442. //     DWORD  dmICMIntent;
  443. //     DWORD  dmMediaType;
  444. //     DWORD  dmDitherType;
  445. //     DWORD  dmReserved1;
  446. //     DWORD  dmReserved2;
  447. // #endif /* WINVER */
  448. } DEVMODEW, *PDEVMODEW, *NPDEVMODEW, *LPDEVMODEW;
  449.  
  450. #ifdef UNICODE
  451. typedef DEVMODEW DEVMODE;
  452. typedef PDEVMODEW PDEVMODE;
  453. typedef NPDEVMODEW NPDEVMODE;
  454. typedef LPDEVMODEW LPDEVMODE;
  455. #else
  456. typedef DEVMODEA DEVMODE;
  457. typedef PDEVMODEA PDEVMODE;
  458. typedef NPDEVMODEA NPDEVMODE;
  459. typedef LPDEVMODEA LPDEVMODE;
  460. #endif
  461.  
  462. /* field selection bits */
  463. #define DM_ORIENTATION      0x00000001L
  464. #define DM_PAPERSIZE        0x00000002L
  465. #define DM_PAPERLENGTH      0x00000004L
  466. #define DM_PAPERWIDTH       0x00000008L
  467. #define DM_SCALE            0x00000010L
  468. #define DM_COPIES           0x00000100L
  469. #define DM_DEFAULTSOURCE    0x00000200L
  470. #define DM_PRINTQUALITY     0x00000400L
  471. #define DM_COLOR            0x00000800L
  472. #define DM_DUPLEX           0x00001000L
  473. #define DM_YRESOLUTION      0x00002000L
  474. #define DM_TTOPTION         0x00004000L
  475. #define DM_COLLATE          0x00008000L
  476. #define DM_FORMNAME         0x00010000L
  477. #define DM_LOGPIXELS        0x00020000L
  478. #define DM_BITSPERPEL       0x00040000L
  479. #define DM_PELSWIDTH        0x00080000L
  480. #define DM_PELSHEIGHT       0x00100000L
  481. #define DM_DISPLAYFLAGS     0x00200000L
  482. #define DM_DISPLAYFREQUENCY 0x00400000L
  483.  
  484. /* orientation selections */
  485. #define DMORIENT_PORTRAIT   1
  486. #define DMORIENT_LANDSCAPE  2
  487.  
  488. /* paper selections */
  489. #define DMPAPER_LETTER               1  /* Letter 8 1/2 x 11 in               */
  490. #define DMPAPER_LEGAL                5  /* Legal 8 1/2 x 14 in                */
  491. #define DMPAPER_A4                   9  /* A4 210 x 297 mm                    */
  492. #define DMPAPER_B4                  12  /* B4 (JIS) 250 x 354                 */
  493. #define DMPAPER_B5                  13  /* B5 (JIS) 182 x 257 mm              */
  494.  
  495. /* print qualities */
  496. #define DMRES_DRAFT         (-1)
  497. #define DMRES_HIGH          (-4)
  498.  
  499. /* color enable/disable for color printers */
  500. #define DMCOLOR_MONOCHROME  1
  501. #define DMCOLOR_COLOR       2
  502.  
  503. WINGDIAPI BOOL     WINAPI SetViewportOrgEx(HDC,int,int,LPPOINT);
  504.  
  505. // @CESYSGEN ENDIF
  506.  
  507.  
  508. // @CESYSGEN IF GWES_MGDRAW
  509. /* Binary raster ops */
  510. #define R2_BLACK            1   /*  0       */
  511. #define R2_NOTMERGEPEN      2   /* DPon     */
  512. #define R2_MASKNOTPEN       3   /* DPna     */
  513. #define R2_NOTCOPYPEN       4   /* PN       */
  514. #define R2_MASKPENNOT       5   /* PDna     */
  515. #define R2_NOT              6   /* Dn       */
  516. #define R2_XORPEN           7   /* DPx      */
  517. #define R2_NOTMASKPEN       8   /* DPan     */
  518. #define R2_MASKPEN          9   /* DPa      */
  519. #define R2_NOTXORPEN        10  /* DPxn     */
  520. #define R2_NOP              11  /* D        */
  521. #define R2_MERGENOTPEN      12  /* DPno     */
  522. #define R2_COPYPEN          13  /* P        */
  523. #define R2_MERGEPENNOT      14  /* PDno     */
  524. #define R2_MERGEPEN         15  /* DPo      */
  525. #define R2_WHITE            16  /*  1       */
  526. #define R2_LAST             16
  527.  
  528. /* Brush Styles */
  529. #define BS_PATTERN          3
  530. #define BS_INDEXED          4
  531. #define BS_DIBPATTERN       5
  532. #define BS_PATTERN8X8       7
  533. #define BS_DIBPATTERN8X8    8
  534. #define BS_MONOPATTERN      9
  535.  
  536. WINGDIAPI HBRUSH WINAPI CreatePatternBrush(HBITMAP);
  537. WINGDIAPI HPEN   WINAPI CreatePen(int, int, COLORREF);
  538. WINGDIAPI BOOL   WINAPI FillRgn(HDC, HRGN, HBRUSH);
  539. WINGDIAPI int    WINAPI SetROP2(HDC, int);
  540. // @CESYSGEN ENDIF
  541.  
  542.  
  543. // @CESYSGEN IF GWES_PGDI || GWES_MGDRAW
  544. #define BS_SOLID            0
  545. #define BS_NULL             1
  546. #define BS_HOLLOW           BS_NULL
  547. #define BS_DIBPATTERNPT     6
  548.  
  549. #define PS_SOLID            0
  550. #define PS_DASH             1
  551. #define PS_NULL             5
  552.  
  553. typedef struct tagLOGBRUSH {
  554.     UINT        lbStyle;
  555.     COLORREF    lbColor;
  556.     LONG        lbHatch;
  557. } LOGBRUSH, *PLOGBRUSH, NEAR *NPLOGBRUSH, FAR *LPLOGBRUSH;
  558.  
  559. typedef struct tagLOGPEN {
  560.     UINT        lopnStyle;
  561.     POINT       lopnWidth;
  562.     COLORREF    lopnColor;
  563. } LOGPEN, *PLOGPEN, NEAR *NPLOGPEN, FAR *LPLOGPEN;
  564.  
  565. WINGDIAPI HBRUSH   WINAPI CreateDIBPatternBrushPt(CONST VOID *,UINT);
  566. WINGDIAPI HPEN     WINAPI CreatePenIndirect(CONST LOGPEN *);
  567. WINGDIAPI HBRUSH   WINAPI CreateSolidBrush(COLORREF);
  568. WINGDIAPI BOOL     WINAPI DrawEdge(HDC,RECT *,UINT,UINT);
  569. WINGDIAPI BOOL     WINAPI DrawFocusRect(HDC,CONST RECT *);
  570. WINGDIAPI BOOL     WINAPI Ellipse(HDC,int,int,int,int);
  571. WINGDIAPI int      WINAPI FillRect(HDC,CONST RECT *,HBRUSH);
  572. WINGDIAPI COLORREF WINAPI GetPixel(HDC,int,int);
  573. WINGDIAPI HBRUSH   WINAPI GetSysColorBrush(int);
  574. WINGDIAPI BOOL     WINAPI Polygon(HDC,CONST POINT *,int);
  575. WINGDIAPI BOOL     WINAPI Polyline(HDC,CONST POINT *,int);
  576. WINGDIAPI BOOL     WINAPI Rectangle(HDC,int,int,int,int);
  577. WINGDIAPI BOOL     WINAPI RoundRect(HDC,int,int,int,int,int,int);
  578. WINGDIAPI BOOL     WINAPI SetBrushOrgEx(HDC,int,int,LPPOINT);
  579. WINGDIAPI COLORREF WINAPI SetPixel(HDC,int,int,COLORREF);
  580. // @CESYSGEN ENDIF
  581.  
  582.  
  583. // @CESYSGEN IF GWES_PGDI || GWES_MGBITMAP
  584. WINGDIAPI  HBITMAP   WINAPI CreateBitmap(int,int,UINT,UINT,CONST VOID *);
  585. WINGDIAPI  HBITMAP   WINAPI CreateCompatibleBitmap(HDC,int,int);
  586. // @CESYSGEN ENDIF
  587.  
  588.  
  589. // @CESYSGEN IF GWES_MGBITMAP || GWES_MGDX
  590. /* structures for defining DIBs */
  591. typedef struct tagBITMAPCOREHEADER {
  592.         DWORD   bcSize;                 /* used to get to color table */
  593.         WORD    bcWidth;
  594.         WORD    bcHeight;
  595.         WORD    bcPlanes;
  596.         WORD    bcBitCount;
  597. } BITMAPCOREHEADER, FAR *LPBITMAPCOREHEADER, *PBITMAPCOREHEADER;
  598.  
  599. typedef struct tagBITMAPCOREINFO {
  600.     BITMAPCOREHEADER    bmciHeader;
  601.     RGBTRIPLE           bmciColors[1];
  602. } BITMAPCOREINFO, FAR *LPBITMAPCOREINFO, *PBITMAPCOREINFO;
  603. // @CESYSGEN ENDIF
  604.  
  605.  
  606. // @CESYSGEN IF GWES_PGDI || GWES_MGRGN
  607. typedef struct _RGNDATAHEADER {
  608.     DWORD   dwSize;
  609.     DWORD   iType;
  610.     DWORD   nCount;
  611.     DWORD   nRgnSize;
  612.     RECT    rcBound;
  613. } RGNDATAHEADER, *PRGNDATAHEADER;
  614.  
  615. typedef struct _RGNDATA {
  616.     RGNDATAHEADER   rdh;
  617.     char            Buffer[1];
  618. } RGNDATA, *PRGNDATA, NEAR *NPRGNDATA, FAR *LPRGNDATA;
  619. // @CESYSGEN ENDIF
  620.  
  621.  
  622. // @CESYSGEN IF GWES_PGDI || GWES_MGRGN
  623. #define NULLREGION          1
  624. #define SIMPLEREGION        2
  625. #define COMPLEXREGION       3
  626. #define RGN_ERROR            ERROR
  627.  
  628. #define RGN_AND             1
  629. #define RGN_OR              2
  630. #define RGN_XOR             3
  631. #define RGN_DIFF            4
  632. #define RGN_COPY            5
  633. #define RGN_MIN             RGN_AND
  634. #define RGN_MAX             RGN_COPY
  635.  
  636. WINGDIAPI  int       WINAPI CombineRgn(HRGN,HRGN,HRGN,int);
  637. WINGDIAPI  HRGN      WINAPI CreateRectRgnIndirect(CONST RECT *);
  638. WINGDIAPI  BOOL      WINAPI EqualRgn(HRGN,HRGN);
  639. WINGDIAPI  int       WINAPI ExcludeClipRect(HDC,int,int,int,int);
  640. WINGDIAPI  int       WINAPI GetClipBox(HDC,LPRECT);
  641. WINGDIAPI  int       WINAPI GetClipRgn(HDC,HRGN);
  642. WINGDIAPI  DWORD     WINAPI GetRegionData(HRGN,DWORD,LPRGNDATA);
  643. WINGDIAPI  int       WINAPI GetRgnBox(HRGN,RECT *);
  644. WINGDIAPI  int       WINAPI IntersectClipRect(HDC,int,int,int,int);
  645. WINGDIAPI  int       WINAPI OffsetRgn(HRGN,int,int);
  646. WINGDIAPI  BOOL      WINAPI PtInRegion(HRGN,int,int);
  647. WINGDIAPI  BOOL      WINAPI RectInRegion(HRGN,CONST RECT *);
  648. WINGDIAPI  int       WINAPI SelectClipRgn(HDC,HRGN);
  649. // @CESYSGEN ENDIF
  650.  
  651.  
  652. // @CESYSGEN IF GWES_MGRGN
  653. WINGDIAPI HRGN  WINAPI  CreateRectRgn(int, int, int, int); 
  654. WINGDIAPI BOOL  WINAPI  RectVisible(HDC, CONST RECT *);
  655. WINGDIAPI BOOL  WINAPI  SetRectRgn(HRGN, int, int, int, int);
  656. // @CESYSGEN ENDIF
  657.  
  658.  
  659. // @CESYSGEN IF GWES_PGDI || GWES_MGBLT
  660. /* Ternary raster operations */
  661. #define SRCCOPY             (DWORD)0x00CC0020 /* dest = source                   */
  662. #define SRCPAINT            (DWORD)0x00EE0086 /* dest = source OR dest           */
  663. #define SRCAND              (DWORD)0x008800C6 /* dest = source AND dest          */
  664. #define SRCINVERT           (DWORD)0x00660046 /* dest = source XOR dest          */
  665. #define SRCERASE            (DWORD)0x00440328 /* dest = source AND (NOT dest )   */
  666. #define NOTSRCCOPY          (DWORD)0x00330008 /* dest = (NOT source)             */
  667. #define NOTSRCERASE         (DWORD)0x001100A6 /* dest = (NOT src) AND (NOT dest) */
  668. #define MERGECOPY           (DWORD)0x00C000CA /* dest = (source AND pattern)     */
  669. #define MERGEPAINT          (DWORD)0x00BB0226 /* dest = (NOT source) OR dest     */
  670. #define PATCOPY             (DWORD)0x00F00021 /* dest = pattern                  */
  671. #define PATPAINT            (DWORD)0x00FB0A09 /* dest = DPSnoo                   */
  672. #define PATINVERT           (DWORD)0x005A0049 /* dest = pattern XOR dest         */
  673. #define DSTINVERT           (DWORD)0x00550009 /* dest = (NOT dest)               */
  674. #define BLACKNESS           (DWORD)0x00000042 /* dest = BLACK                    */
  675. #define WHITENESS           (DWORD)0x00FF0062 /* dest = WHITE                    */
  676.  
  677. WINGDIAPI  BOOL      WINAPI BitBlt(HDC,int,int,int,int,HDC,int,int,DWORD);
  678. // @CESYSGEN ENDIF
  679.  
  680.  
  681. // @CESYSGEN IF GWES_PGDI || GWES_MGBLT2
  682. /* Quaternary raster codes */
  683. #define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
  684.  
  685. WINGDIAPI  BOOL      WINAPI MaskBlt(HDC,int,int,int,int,HDC,int,int,HBITMAP,int,int,DWORD);
  686. WINGDIAPI  BOOL         WINAPI PatBlt(HDC,int,int,int,int,DWORD);
  687. WINGDIAPI  BOOL      WINAPI StretchBlt(HDC,int,int,int,int,HDC,int,int,int,int,DWORD);
  688. // @CESYSGEN ENDIF
  689.  
  690.  
  691. // @CESYSGEN IF GWES_MGBLT2
  692. WINGDIAPI  BOOL      WINAPI TransparentImage(HDC,int,int,int,int,HANDLE,int,int,int,int,COLORREF);
  693. // @CESYSGEN ENDIF
  694.  
  695.  
  696. // @CESYSGEN IF GWES_PGDI || GWES_MGTT || GWES_MGRAST
  697. #define ETO_OPAQUE                   0x0002
  698. #define ETO_CLIPPED                  0x0004
  699.  
  700. #define OUT_DEFAULT_PRECIS      0
  701. #define OUT_STRING_PRECIS       1
  702. #define OUT_RASTER_PRECIS       6
  703. #define CLIP_DEFAULT_PRECIS     0
  704. #define CLIP_CHARACTER_PRECIS   1
  705. #define CLIP_STROKE_PRECIS      2
  706.  
  707. #define DEFAULT_QUALITY            0
  708. #define DRAFT_QUALITY            1
  709. #define RASTER_FONTTYPE            0x0001
  710. #define NONANTIALIASED_QUALITY  3
  711. #define ANTIALIASED_QUALITY     4
  712.  
  713. #ifdef UNICODE
  714. #define LOGFONT                    LOGFONTW
  715. #define PLOGFONT                PLOGFONTW
  716. #define NPLOGFONT                NPLOGFONTW
  717. #define LPLOGFONT                LPLOGFONTW
  718. #else
  719. #define LOGFONT                    LOGFONTA
  720. #define PLOGFONT                PLOGFONTA
  721. #define NPLOGFONT                NPLOGFONTA
  722. #define LPLOGFONT                LPLOGFONTA
  723. #endif //!UNICODE
  724.  
  725. #define DEFAULT_PITCH           0
  726. #define FIXED_PITCH             1
  727. #define VARIABLE_PITCH          2
  728.  
  729. #define ANSI_CHARSET            0
  730. #define DEFAULT_CHARSET         1
  731. #define SYMBOL_CHARSET          2
  732. #define SHIFTJIS_CHARSET        128
  733. #define HANGEUL_CHARSET         129
  734. #define GB2312_CHARSET          134
  735. #define CHINESEBIG5_CHARSET     136
  736. #define OEM_CHARSET             255
  737.  
  738. #define JOHAB_CHARSET           130
  739. #define HEBREW_CHARSET          177
  740. #define ARABIC_CHARSET          178
  741. #define GREEK_CHARSET           161
  742. #define TURKISH_CHARSET         162
  743. #define VIETNAMESE_CHARSET      163
  744. #define THAI_CHARSET            222
  745. #define EASTEUROPE_CHARSET      238
  746. #define RUSSIAN_CHARSET         204
  747. #define MAC_CHARSET             77
  748. #define BALTIC_CHARSET          186
  749.  
  750. #define FS_LATIN1               0x00000001L
  751. #define FS_LATIN2               0x00000002L
  752. #define FS_CYRILLIC             0x00000004L
  753. #define FS_GREEK                0x00000008L
  754. #define FS_TURKISH              0x00000010L
  755. #define FS_HEBREW               0x00000020L
  756. #define FS_ARABIC               0x00000040L
  757. #define FS_BALTIC               0x00000080L
  758. #define FS_VIETNAMESE           0x00000100L
  759. #define FS_THAI                 0x00010000L
  760. #define FS_JISJAPAN             0x00020000L
  761. #define FS_CHINESESIMP          0x00040000L
  762. #define FS_WANSUNG              0x00080000L
  763. #define FS_CHINESETRAD          0x00100000L
  764. #define FS_JOHAB                0x00200000L
  765. #define FS_SYMBOL               0x80000000L
  766.  
  767. /* Font Families */
  768. #define FF_DONTCARE         (0<<4)  /* Don't care or don't know. */
  769. #define FF_ROMAN            (1<<4)  /* Variable stroke width, serifed. */
  770.                                     /* Times Roman, Century Schoolbook, etc. */
  771. #define FF_SWISS            (2<<4)  /* Variable stroke width, sans-serifed. */
  772.                                     /* Helvetica, Swiss, etc. */
  773. #define FF_MODERN           (3<<4)  /* Constant stroke width, serifed or sans-serifed. */
  774.                                     /* Pica, Elite, Courier, etc. */
  775. #define FF_SCRIPT           (4<<4)  /* Cursive, etc. */
  776. #define FF_DECORATIVE       (5<<4)  /* Old English, etc. */
  777.  
  778. /* Font Weights */
  779. #define FW_DONTCARE         0
  780. #define FW_THIN             100
  781. #define FW_EXTRALIGHT       200
  782. #define FW_LIGHT            300
  783. #define FW_NORMAL           400
  784. #define FW_MEDIUM           500
  785. #define FW_SEMIBOLD         600
  786. #define FW_BOLD             700
  787. #define FW_EXTRABOLD        800
  788. #define FW_HEAVY            900
  789.  
  790. /* tmPitchAndFamily flags */
  791. #define TMPF_FIXED_PITCH    0x01
  792. #define TMPF_VECTOR         0x02
  793. #define TMPF_DEVICE         0x08
  794. #define TMPF_TRUETYPE       0x04
  795.  
  796. typedef struct tagTEXTMETRICA
  797. {
  798.     LONG        tmHeight;
  799.     LONG        tmAscent;
  800.     LONG        tmDescent;
  801.     LONG        tmInternalLeading;
  802.     LONG        tmExternalLeading;
  803.     LONG        tmAveCharWidth;
  804.     LONG        tmMaxCharWidth;
  805.     LONG        tmWeight;
  806.     LONG        tmOverhang;
  807.     LONG        tmDigitizedAspectX;
  808.     LONG        tmDigitizedAspectY;
  809.     char        tmFirstChar;
  810.     char        tmLastChar;
  811.     char        tmDefaultChar;
  812.     char        tmBreakChar;
  813.     BYTE        tmItalic;
  814.     BYTE        tmUnderlined;
  815.     BYTE        tmStruckOut;
  816.     BYTE        tmPitchAndFamily;
  817.     BYTE        tmCharSet;
  818. } TEXTMETRICA, *PTEXTMETRICA, NEAR *NPTEXTMETRICA, FAR *LPTEXTMETRICA;
  819.  
  820. typedef struct tagTEXTMETRICW
  821. {
  822.     LONG        tmHeight;
  823.     LONG        tmAscent;
  824.     LONG        tmDescent;
  825.     LONG        tmInternalLeading;
  826.     LONG        tmExternalLeading;
  827.     LONG        tmAveCharWidth;
  828.     LONG        tmMaxCharWidth;
  829.     LONG        tmWeight;
  830.     LONG        tmOverhang;
  831.     LONG        tmDigitizedAspectX;
  832.     LONG        tmDigitizedAspectY;
  833.     WCHAR       tmFirstChar;
  834.     WCHAR       tmLastChar;
  835.     WCHAR       tmDefaultChar;
  836.     WCHAR       tmBreakChar;
  837.     BYTE        tmItalic;
  838.     BYTE        tmUnderlined;
  839.     BYTE        tmStruckOut;
  840.     BYTE        tmPitchAndFamily;
  841.     BYTE        tmCharSet;
  842. } TEXTMETRICW, *PTEXTMETRICW, NEAR *NPTEXTMETRICW, FAR *LPTEXTMETRICW;
  843.  
  844. #ifdef UNICODE
  845. typedef TEXTMETRICW TEXTMETRIC;
  846. typedef PTEXTMETRICW PTEXTMETRIC;
  847. typedef NPTEXTMETRICW NPTEXTMETRIC;
  848. typedef LPTEXTMETRICW LPTEXTMETRIC;
  849. #else
  850. typedef TEXTMETRICA TEXTMETRIC;
  851. typedef PTEXTMETRICA PTEXTMETRIC;
  852. typedef NPTEXTMETRICA NPTEXTMETRIC;
  853. typedef LPTEXTMETRICA LPTEXTMETRIC;
  854. #endif // UNICODE
  855.  
  856. /* ntmFlags field flags */
  857. #define NTM_REGULAR     0x00000040L
  858. #define NTM_BOLD        0x00000020L
  859. #define NTM_ITALIC      0x00000001L
  860.  
  861. typedef struct tagNEWTEXTMETRICA
  862. {
  863.     LONG        tmHeight;
  864.     LONG        tmAscent;
  865.     LONG        tmDescent;
  866.     LONG        tmInternalLeading;
  867.     LONG        tmExternalLeading;
  868.     LONG        tmAveCharWidth;
  869.     LONG        tmMaxCharWidth;
  870.     LONG        tmWeight;
  871.     LONG        tmOverhang;
  872.     LONG        tmDigitizedAspectX;
  873.     LONG        tmDigitizedAspectY;
  874.     BYTE        tmFirstChar;
  875.     BYTE        tmLastChar;
  876.     BYTE        tmDefaultChar;
  877.     BYTE        tmBreakChar;
  878.     BYTE        tmItalic;
  879.     BYTE        tmUnderlined;
  880.     BYTE        tmStruckOut;
  881.     BYTE        tmPitchAndFamily;
  882.     BYTE        tmCharSet;
  883.     DWORD       ntmFlags;
  884.     UINT        ntmSizeEM;
  885.     UINT        ntmCellHeight;
  886.     UINT        ntmAvgWidth;
  887. } NEWTEXTMETRICA, *PNEWTEXTMETRICA, NEAR *NPNEWTEXTMETRICA, FAR *LPNEWTEXTMETRICA;
  888.  
  889. typedef struct tagNEWTEXTMETRICW
  890. {
  891.     LONG        tmHeight;
  892.     LONG        tmAscent;
  893.     LONG        tmDescent;
  894.     LONG        tmInternalLeading;
  895.     LONG        tmExternalLeading;
  896.     LONG        tmAveCharWidth;
  897.     LONG        tmMaxCharWidth;
  898.     LONG        tmWeight;
  899.     LONG        tmOverhang;
  900.     LONG        tmDigitizedAspectX;
  901.     LONG        tmDigitizedAspectY;
  902.     WCHAR       tmFirstChar;
  903.     WCHAR       tmLastChar;
  904.     WCHAR       tmDefaultChar;
  905.     WCHAR       tmBreakChar;
  906.     BYTE        tmItalic;
  907.     BYTE        tmUnderlined;
  908.     BYTE        tmStruckOut;
  909.     BYTE        tmPitchAndFamily;
  910.     BYTE        tmCharSet;
  911.     DWORD       ntmFlags;
  912.     UINT        ntmSizeEM;
  913.     UINT        ntmCellHeight;
  914.     UINT        ntmAvgWidth;
  915. } NEWTEXTMETRICW, *PNEWTEXTMETRICW, NEAR *NPNEWTEXTMETRICW, FAR *LPNEWTEXTMETRICW;
  916.  
  917. #ifdef UNICODE
  918. typedef NEWTEXTMETRICW NEWTEXTMETRIC;
  919. typedef PNEWTEXTMETRICW PNEWTEXTMETRIC;
  920. typedef NPNEWTEXTMETRICW NPNEWTEXTMETRIC;
  921. typedef LPNEWTEXTMETRICW LPNEWTEXTMETRIC;
  922. #else
  923. typedef NEWTEXTMETRICA NEWTEXTMETRIC;
  924. typedef PNEWTEXTMETRICA PNEWTEXTMETRIC;
  925. typedef NPNEWTEXTMETRICA NPNEWTEXTMETRIC;
  926. typedef LPNEWTEXTMETRICA LPNEWTEXTMETRIC;
  927. #endif // UNICODE
  928.  
  929. WINGDIAPI  int       WINAPI AddFontResourceA(LPWSTR);
  930. WINGDIAPI  int       WINAPI AddFontResourceW(LPCWSTR);
  931. WINGDIAPI  HFONT     WINAPI CreateFontIndirectA(CONST LOGFONTA *);
  932. WINGDIAPI  HFONT     WINAPI CreateFontIndirectW(CONST LOGFONTW *);
  933. WINGDIAPI  BOOL      WINAPI ExtTextOutA(HDC,int,int,UINT,CONST RECT *,LPCSTR,UINT,CONST INT *);
  934. WINGDIAPI  BOOL      WINAPI ExtTextOutW(HDC,int,int,UINT,CONST RECT *,LPCWSTR,UINT,CONST INT *);
  935. WINGDIAPI  BOOL      WINAPI GetTextExtentExPointA(HDC,LPCSTR,int,int,LPINT,LPINT,LPSIZE);
  936. WINGDIAPI  BOOL      WINAPI GetTextExtentExPointW(HDC,LPCWSTR,int,int,LPINT,LPINT,LPSIZE);
  937. WINGDIAPI  BOOL      WINAPI GetTextMetricsA(HDC,LPTEXTMETRICA);
  938. WINGDIAPI  BOOL      WINAPI GetTextMetricsW(HDC,LPTEXTMETRICW);
  939. WINGDIAPI  BOOL      WINAPI RemoveFontResourceA(LPCSTR);
  940. WINGDIAPI  BOOL      WINAPI RemoveFontResourceW(LPCWSTR);
  941.  
  942.  
  943. /* GetTextExtentPoint variants */
  944. #define GetTextExtentPointW(hdc, lpString, cbString, lpSize) \
  945.         GetTextExtentExPointW(hdc, lpString, cbString, 0, NULL, NULL, lpSize)
  946.  
  947. #define GetTextExtentPointA(hdc, lpString, cbString, lpSize) \
  948.         GetTextExtentExPointA(hdc, lpString, cbString, 0, NULL, NULL, lpSize)
  949.  
  950. #ifdef UNICODE
  951. #define GetTextExtentPoint(hdc, lpString, cbString, lpSize) \
  952.         GetTextExtentPointW(hdc, lpString, cbString, lpSize)
  953. #else
  954. #define GetTextExtentPoint(hdc, lpString, cbString, lpSize) \
  955.         GetTextExtentPointA(hdc, lpString, cbString, lpSize)
  956. #endif
  957.  
  958.  
  959. /* GetTextExtentPoint32 variants */
  960. #define GetTextExtentPoint32W(hdc, lpString, cbString, lpSize) \
  961.         GetTextExtentPointW(hdc, lpString, cbString, lpSize)
  962.  
  963. #define GetTextExtentPoint32A(hdc, lpString, cbString, lpSize) \
  964.         GetTextExtentPointA(hdc, lpString, cbString, lpSize)
  965.  
  966. #define GetTextExtentPoint32(hdc, lpString, cbString, lpSize) \
  967.         GetTextExtentPoint(hdc, lpString, cbString, lpSize)
  968.  
  969.  
  970. #ifdef UNICODE
  971. #define AddFontResource         AddFontResourceW
  972. #define CreateFontIndirect      CreateFontIndirectW
  973. #define ExtTextOut              ExtTextOutW
  974. #define GetTextExtentExPoint    GetTextExtentExPointW
  975. #define GetTextMetrics          GetTextMetricsW
  976. #define RemoveFontResource      RemoveFontResourceW
  977. #else
  978. #define AddFontResource         AddFontResourceA
  979. #define CreateFontIndirect      CreateFontIndirectA
  980. #define ExtTextOut              ExtTextOutA
  981. #define GetTextExtentExPoint    GetTextExtentExPointA
  982. #define GetTextMetrics          GetTextMetricsA
  983. #define RemoveFontResource      RemoveFontResourceA
  984. #endif //UNICODE
  985. // @CESYSGEN ENDIF
  986.  
  987.  
  988. // @CESYSGEN IF GWES_PGDI || GWES_MGDRWTXT
  989. /* DrawText() Format Flags */
  990. #define DT_TOP              0x00000000
  991. #define DT_LEFT             0x00000000
  992. #define DT_CENTER           0x00000001
  993. #define DT_RIGHT            0x00000002
  994. #define DT_VCENTER          0x00000004
  995. #define DT_BOTTOM           0x00000008
  996. #define DT_WORDBREAK        0x00000010
  997. #define DT_SINGLELINE       0x00000020
  998. #define DT_EXPANDTABS       0x00000040
  999. #define DT_TABSTOP          0x00000080
  1000. #define DT_NOCLIP           0x00000100
  1001. #define DT_EXTERNALLEADING  0x00000200
  1002. #define DT_CALCRECT         0x00000400
  1003. #define DT_NOPREFIX         0x00000800
  1004. #define DT_INTERNAL         0x00001000
  1005.  
  1006. WINUSERAPI int WINAPI DrawTextA(HDC,LPCSTR,int,RECT *,UINT);
  1007. WINUSERAPI int WINAPI WINAPI DrawTextW(HDC,LPCWSTR,int,RECT *,UINT);
  1008.  
  1009. #ifdef UNICODE
  1010. #define DrawText                DrawTextW
  1011. #else
  1012. #define DrawText                DrawTextA
  1013. #endif
  1014. // @CESYSGEN ENDIF
  1015.  
  1016.  
  1017. // @CESYSGEN IF GWES_PGDI || GWES_MGTT || GWES_MGRAST2
  1018. #define LF_FULLFACESIZE     64
  1019. typedef struct tagENUMLOGFONT
  1020. {
  1021.     LOGFONT   elfLogFont;
  1022.     TCHAR     elfFullName[LF_FULLFACESIZE];
  1023.     TCHAR     elfStyle[LF_FACESIZE];
  1024. } ENUMLOGFONT, FAR* LPENUMLOGFONT;
  1025.  
  1026. typedef int (CALLBACK* FONTENUMPROC)(CONST LOGFONT *, CONST TEXTMETRIC *, DWORD, LPARAM);
  1027.  
  1028. WINGDIAPI  int       WINAPI EnumFontFamiliesA(HDC,LPCSTR,FONTENUMPROC,LPARAM);
  1029. WINGDIAPI  int       WINAPI EnumFontFamiliesW(HDC,LPCWSTR,FONTENUMPROC,LPARAM);
  1030. WINGDIAPI  int       WINAPI EnumFontsA(HDC,LPCSTR,FONTENUMPROC,LPARAM);
  1031. WINGDIAPI  int       WINAPI EnumFontsW(HDC,LPCWSTR,FONTENUMPROC,LPARAM);
  1032. WINGDIAPI  int       WINAPI GetTextFaceA(HDC,int,LPSTR);
  1033. WINGDIAPI  int       WINAPI GetTextFaceW(HDC,int,LPWSTR);
  1034.  
  1035. #ifdef UNICODE
  1036. #define EnumFontFamilies        EnumFontFamiliesW
  1037. #define EnumFonts               EnumFontsW
  1038. #define GetTextFace             GetTextFaceW
  1039. #else
  1040. #define EnumFontFamilies        EnumFontFamiliesA
  1041. #define EnumFonts               EnumFontsA
  1042. #define GetTextFace             GetTextFaceA
  1043. #endif //UNICODE
  1044. // @CESYSGEN ENDIF
  1045.  
  1046.  
  1047. // @CESYSGEN IF GWES_MGTT
  1048. WINGDIAPI  BOOL      WINAPI EnableEUDC(BOOL);
  1049. // @CESYSGEN ENDIF
  1050.  
  1051.  
  1052. // @CESYSGEN IF GWES_MGTCI
  1053. typedef struct tagFONTSIGNATURE
  1054. {
  1055.     DWORD fsUsb[4];
  1056.     DWORD fsCsb[2];
  1057. } FONTSIGNATURE, *PFONTSIGNATURE,FAR *LPFONTSIGNATURE;
  1058.  
  1059. typedef struct tagCHARSETINFO
  1060. {
  1061.     UINT ciCharset;
  1062.     UINT ciACP;
  1063.     FONTSIGNATURE fs;
  1064. } CHARSETINFO, *PCHARSETINFO, NEAR *NPCHARSETINFO, FAR *LPCHARSETINFO;
  1065.  
  1066. #define TCI_SRCCHARSET  1
  1067. #define TCI_SRCCODEPAGE 2
  1068. #define TCI_SRCFONTSIG  3
  1069.  
  1070. WINGDIAPI   BOOL    WINAPI TranslateCharsetInfo(DWORD *, LPCHARSETINFO, DWORD dwFlags);
  1071. // @CESYSGEN ENDIF
  1072.  
  1073.  
  1074. // @CESYSGEN IF GWES_PGDI || GWES_MGDIBSEC
  1075. #define DIB_RGB_COLORS      0 /* color table in RGBs */
  1076. #define DIB_PAL_COLORS      1 /* color table in palette indices */
  1077.  
  1078. typedef struct tagDIBSECTION {
  1079.     BITMAP              dsBm;
  1080.     BITMAPINFOHEADER    dsBmih;
  1081.     DWORD               dsBitfields[3];
  1082.     HANDLE              dshSection;
  1083.     DWORD               dsOffset;
  1084. } DIBSECTION, FAR *LPDIBSECTION, *PDIBSECTION;
  1085.  
  1086. WINGDIAPI  HBITMAP   WINAPI CreateDIBSection(HDC,CONST BITMAPINFO *,UINT,VOID **,HANDLE,DWORD);
  1087. // @CESYSGEN ENDIF
  1088.  
  1089.  
  1090. // @CESYSGEN IF GWES_PGDI || GWES_MGDC
  1091. WINGDIAPI BOOL WINAPI RestoreDC(HDC,int);
  1092. WINGDIAPI int  WINAPI SaveDC(HDC);
  1093. // @CESYSGEN ENDIF
  1094.  
  1095.  
  1096. // @CESYSGEN IF GWES_MGDC
  1097. WINGDIAPI HDC  WINAPI CreateDCA(LPCSTR, LPCSTR , LPCSTR , CONST DEVMODEA *);
  1098. WINGDIAPI HDC  WINAPI CreateDCW(LPCWSTR, LPCWSTR , LPCWSTR , CONST DEVMODEW *);
  1099. WINGDIAPI int  WINAPI ExtEscape(HDC, int, int, LPCSTR, int, LPSTR);
  1100.  
  1101. #ifdef UNICODE
  1102. #define CreateDC  CreateDCW
  1103. #else
  1104. #define CreateDC  CreateDCA
  1105. #endif // !UNICODE
  1106. // @CESYSGEN ENDIF
  1107.  
  1108.  
  1109. // @CESYSGEN IF GWES_MGPAL
  1110. WINGDIAPI HPALETTE WINAPI CreatePalette(CONST LOGPALETTE *);
  1111. WINGDIAPI UINT     WINAPI GetNearestPaletteIndex(HPALETTE, COLORREF);
  1112. WINGDIAPI UINT     WINAPI GetPaletteEntries(HPALETTE, UINT, UINT, LPPALETTEENTRY);
  1113. WINGDIAPI UINT     WINAPI GetSystemPaletteEntries(HDC, UINT, UINT, LPPALETTEENTRY);
  1114. WINGDIAPI UINT     WINAPI RealizePalette(HDC);
  1115. WINGDIAPI HPALETTE WINAPI SelectPalette(HDC, HPALETTE, BOOL);
  1116. WINGDIAPI UINT     WINAPI SetPaletteEntries(HPALETTE, UINT, UINT, CONST PALETTEENTRY *);
  1117. // @CESYSGEN ENDIF
  1118.  
  1119.  
  1120. // @CESYSGEN IF GWES_PGDI || GWES_MGPAL
  1121. WINGDIAPI COLORREF WINAPI GetNearestColor(HDC, COLORREF);
  1122. // @CESYSGEN ENDIF
  1123.  
  1124.  
  1125. // @CESYSGEN IF GWES_MGPRINT
  1126. /* Spooler Error Codes */
  1127. #define SP_ERROR                     (-1)
  1128.  
  1129. #ifdef STRICT
  1130. typedef BOOL (CALLBACK* ABORTPROC)(HDC, int);
  1131. #else
  1132. typedef FARPROC ABORTPROC;
  1133. #endif
  1134.  
  1135. typedef struct _DOCINFOA {
  1136.     int     cbSize;
  1137.     LPCSTR   lpszDocName;
  1138.     LPCSTR   lpszOutput;
  1139.     LPCSTR   lpszDatatype;
  1140.     DWORD    fwType;
  1141. } DOCINFOA, *LPDOCINFOA;
  1142.  
  1143. typedef struct _DOCINFOW {
  1144.     int     cbSize;
  1145.     LPCWSTR  lpszDocName;
  1146.     LPCWSTR  lpszOutput;
  1147.     LPCWSTR  lpszDatatype;
  1148.     DWORD    fwType;
  1149. } DOCINFOW, *LPDOCINFOW;
  1150.  
  1151. #ifdef UNICODE
  1152. typedef DOCINFOW DOCINFO;
  1153. typedef LPDOCINFOW LPDOCINFO;
  1154. #else
  1155. typedef DOCINFOA DOCINFO;
  1156. typedef LPDOCINFOA LPDOCINFO;
  1157. #endif // UNICODE
  1158.  
  1159. WINGDIAPI int WINAPI AbortDoc(HDC);
  1160. WINGDIAPI int WINAPI EndDoc(HDC);
  1161. WINGDIAPI int WINAPI EndPage(HDC);
  1162. WINGDIAPI int WINAPI SetAbortProc(HDC, ABORTPROC);
  1163. WINGDIAPI int WINAPI StartDocA(HDC, CONST DOCINFOA *);
  1164. WINGDIAPI int WINAPI StartDocW(HDC, CONST DOCINFOW *);
  1165. WINGDIAPI int WINAPI StartPage(HDC);
  1166.  
  1167. #ifdef UNICODE
  1168. #define StartDoc  StartDocW
  1169. #else
  1170. #define StartDoc  StartDocA
  1171. #endif // !UNICODE
  1172. // @CESYSGEN ENDIF
  1173.  
  1174. #ifdef UNDER_NT
  1175.             int         WINAPI MulDiv(int,int,int);
  1176. WINGDIAPI    int            WINAPI SetMapMode(HDC, int);
  1177. WINGDIAPI    BOOL        WINAPI SetViewportExtEx(HDC, int, int, LPSIZE);
  1178. WINGDIAPI    BOOL        WINAPI SetViewportOrgEx(HDC, int, int, LPPOINT);
  1179. WINGDIAPI    int            WINAPI GetDIBits(HDC, HBITMAP, UINT, UINT, LPVOID, LPBITMAPINFO, UINT);
  1180. WINGDIAPI    LONG        WINAPI GetBitmapBits(HBITMAP, LONG, LPVOID);
  1181. WINGDIAPI    UINT        WINAPI GetDIBColorTable(HDC, UINT, UINT, RGBQUAD *);
  1182. WINGDIAPI    int            WINAPI StretchDIBits(HDC, int, int, int, int, int, int, int, 
  1183.                                 int, CONST VOID *, CONST BITMAPINFO *, UINT, DWORD);
  1184. WINGDIAPI    BOOL        WINAPI SetWindowExtEx(HDC, int, int, LPSIZE);
  1185. WINGDIAPI    BOOL        WINAPI SetWindowOrgEx(HDC, int, int, LPPOINT);
  1186. WINGDIAPI    int            WINAPI SetStretchBltMode(HDC, int);
  1187.  
  1188. #define COLORONCOLOR   3
  1189. #define MM_ANISOTROPIC 8
  1190. #endif // UNDER_NT
  1191.  
  1192.  
  1193. #ifdef __cplusplus
  1194. }
  1195. #endif
  1196.  
  1197.  
  1198. #ifdef WINCEOEM
  1199. #include <pwingdi.h>    // internal defines 
  1200. #ifndef GDI_SERVER
  1201. #ifdef WINCEMACRO
  1202. #include <mwingdi.h>     // macro defines
  1203. #endif
  1204. #endif
  1205. #endif
  1206.  
  1207.  
  1208. #endif /* _WINGDI_H_ */
  1209.